<%@ page import="java.net.URLDecoder" %><%--
  Created by IntelliJ IDEA.
  User: zhaoliwen
  Date: 2020/4/17
  Time: 21:25
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE HTML>
<html>
<head>
    <meta http-equiv="Content-type" content="text/html; charset=UTF-8" />
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/login.css"/>
    <title>EasyMall欢迎您登陆</title>
    <script>
        onload=function () {
            var input=document.getElementsByName("userName")[0]
            input.value=decodeURI(input.value)
        }
    </script>
</head>
<body>
<h1>欢迎登陆EasyMall</h1>
<form action="${pageContext.request.contextPath}/user/login.do" method="POST">
    <table>
        <tr>
            <td class="tds" colspan="2" style="color: red;text-align: center">
               ${msg}
            </td>
        </tr>
       <%-- <%
            Cookie[] cookies=request.getCookies();
            Cookie myk=null;
            for(Cookie k:cookies){
                if("rename".equals(k.getName())){
                    myk=k;break;
                }
            }
            String username="";
            if(myk!=null){
                username= URLDecoder.decode(myk.getValue());
            }
        %>--%>
        <tr>
            <td class="tdx">用户名：</td>
            <td><input type="text" name="userName" value="${cookie.rename.value}"/></td>
        </tr>
        <tr>
            <td class="tdx">密&nbsp;&nbsp; 码：</td>
            <td><input type="password" name="passWord"/></td>
        </tr>
        <tr>
            <td colspan="2">
                <input type="checkbox" name="rename" value="true" ${empty cookie.rename.value?"":"checked='checked'"}/>记住用户名
                <input type="checkbox" name="autologin" value="true"  ${empty cookie.autologon.value?"":"checked='checked'"} />30天内自动登陆
            </td>
        </tr>
        <tr>
            <td colspan="2" style="text-align:center">
                <input type="submit" value="登 陆"/>
            </td>
        </tr>
    </table>
</form>
</body>
</html>

